// 引入项目中全部的全局组件
import SvgIcon from "./SvgIcon/index.vue";
import UserDrawer from "./UserDrawer/index.vue";
import TagSelect from "./TagSelect/index.vue";
import UserSelect from "./UserSelect/index.vue";
import MyUpload from "./Upload/index.vue";
import CodeButton from "./CodeButton/index.vue";
// 引入element-plus图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 全局对象
const allGloablComponent: { [key: string]: unknown } = {
    SvgIcon,
    UserDrawer,
    TagSelect,
    UserSelect,
    MyUpload,
    CodeButton,
};
// 对外暴露对象
export default {
    install(app: { component: (name: string, Component: unknown) => void }) {
        Object.keys(allGloablComponent).forEach((key) => {
            app.component(key, allGloablComponent[key]);
        });
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component);
        }
    },
};
